import java.util.Arrays;
import java.util.Scanner;

public class Niuniu {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int n = scanner.nextInt();
            int[] elem = new int[3*n];
            for (int i = 0; i < elem.length; i++) {
                elem[i] = scanner.nextInt();
            }
            Arrays.sort(elem);
            long max = 0;
            for (int i = 0; i < n; i++) {
                max += elem[elem.length - 2*(i+1)];
            }
            System.out.println(max);
        }
    }
}
